#include <stdio.h>

int countbit(unsigned int x) {
    int count = 0;
    while (x != 0) {
        if (x & 1) {
            count++;
        }
        x >>= 1;
    }
    return count;
}

int main() {
    unsigned int num;
    printf("请输入一个无符号整数: ");
    scanf("%u", &num);
    int result = countbit(num);
    printf("该数二进制表示中1的个数为: %d\n", result);
    return 0;
}